package com.bw.module_home.state

import com.bw.lib_mvicore.IState
import com.bw.module_home.model.entity.CommentEntity
import kotlin.random.Random

/**
 * @Author : ZhouZiYao
 * @Time : On 2023/11/29 11:27
 * @Description :
 */
sealed class CommentState: IState {

    /**
     * 成功获取评论信息
     */
    data class CommentSuccessState(val list:MutableList<CommentEntity>):CommentState(){
        override fun equals(other: Any?): Boolean {
            return false
        }

        override fun hashCode(): Int {
            return Random.nextInt()
        }
    }

    /**
     * 获取评论信息失败
     */
    object CommentFailedState : CommentState(){
        override fun equals(other: Any?): Boolean {
            return false
        }

        override fun hashCode(): Int {
            return Random.nextInt()
        }
    }

    /**
     * 发布评论成功
     */
    data class PublishCommentSuccess(val entity:CommentEntity): CommentState(){
        override fun equals(other: Any?): Boolean {
            return false
        }

        override fun hashCode(): Int {
            return Random.nextInt()
        }
    }

    /**
     * 发布评论失败
     */
    object PublishCommentFailed: CommentState(){
        override fun equals(other: Any?): Boolean {
            return false
        }

        override fun hashCode(): Int {
            return Random.nextInt()
        }
    }

//    /**
//     * 出现401错误 即未登录
//     */
//    object PublishComment401Failed:CommentState(){
//        override fun equals(other: Any?): Boolean {
//            return false
//        }
//
//        override fun hashCode(): Int {
//            return Random.nextInt()
//        }
//    }

    /**
     * 初始状态
     */
    object Init : CommentState()

}